//package com.raptor.trustworthy.server.config;
//
//import com.raptor.trustworthy.server.properties.ZookeeperProperties;
//import org.apache.curator.CuratorZookeeperClient;
//import org.apache.curator.RetryPolicy;
//import org.apache.curator.framework.CuratorFramework;
//import org.apache.curator.framework.CuratorFrameworkFactory;
//import org.apache.curator.retry.ExponentialBackoffRetry;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.context.properties.ConfigurationProperties;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
///**
// * 连接zookeeper
// *
// * @Author renhuan
// * @Date 2020-09-09 16:25
// **/
//@Configuration
//public class ZookeeperConfig {
//
//  @Bean(name = "zookeeper")
//  @ConfigurationProperties(prefix = "zookeeper")
//  public ZookeeperProperties zookeeperConfig(){
//    return new ZookeeperProperties();
//  }
//
//  @Bean(name = "zkClient")
//  public CuratorFramework curatorFramework(@Autowired ZookeeperProperties zookeeperProperties){
//    RetryPolicy retryPolicy = new ExponentialBackoffRetry(1000, 3);
//    CuratorFramework client = CuratorFrameworkFactory.newClient(zookeeperProperties.getUrl(), retryPolicy);
//    client.start();
//    return client;
//  }
//
//}
